/* $Id: AttachmentTypeFacadeImpl.java 
 * Copyright (C) 2011, TRAKHEES
 *  
 * Revision History
 *
 * Date  			Author 		    	Remarks
 * ---------------------------------------------------------------------------------
 *
 */
package ae.pcfc.etks.online.common.facade.provider;

import java.util.ArrayList;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import ae.pcfc.etks.online.common.domain.AttachmentType;
import ae.pcfc.etks.online.common.domain.manager.AttachmentTypeDomainObjectManager;
import ae.pcfc.etks.online.common.facade.AttachmentTypeFacade;
import ae.pcfc.etks.online.common.vo.AttachmentTypeVO;


public class AttachmentTypeFacadeImpl  extends BaseFacade implements AttachmentTypeFacade{
    /*
	 * Here we coordinate between the all interacting business domain objects
	 * (BO), transactions are maintained here. use case business validation are
	 * maintained here (that requires DB checks or retrieving data from DB)
	 */
	private AttachmentTypeDomainObjectManager attachmentTypeDomainObjectManager;

	
	public void setAttachmentTypeDomainObjectManager(
			AttachmentTypeDomainObjectManager attachmentTypeDomainObjectManager) {
		this.attachmentTypeDomainObjectManager = attachmentTypeDomainObjectManager;
	}
	

	/**
	 * getAttachmentType
	 * 
	 * @see ae.pcfc.etks.online.common.facade.AttachmentTypeFacade#getAttachmentType(java.lang.String)
	 * 
	 */
	@Transactional(readOnly = true)
	public List<AttachmentTypeVO> getAttachmentType(String strAttachmentTypeUser) {
		
		List<AttachmentType> attachmenttypes = attachmentTypeDomainObjectManager.getAttachmentType(strAttachmentTypeUser);
		
		List<AttachmentTypeVO> attachmentTypeVOs = new ArrayList<AttachmentTypeVO>();
		AttachmentTypeVO attachmentTypeVO;
		
		for(AttachmentType attachmenttype:attachmenttypes)
		{
			attachmentTypeVO = getMapper().map(attachmenttype, AttachmentTypeVO.class);	
			/*attachmentTypeVO.setStrAttachmentTypeCode(attachmenttype.getAttachmentTypeCode());
			attachmentTypeVO.setStrAttachmentTypeDesc(attachmenttype.getAttachmentTypeDesc());
			attachmentTypeVO.setStrAttachmentTypeDescA(attachmenttype.getAttachmentTypeDescA());
			attachmentTypeVO.setStrAttachmentTypeStatus(attachmenttype.getAttachmentTypeStatus());*/
			attachmentTypeVOs.add(attachmentTypeVO);
		}
	
		return attachmentTypeVOs;
	}

}
